<!--#begin editorarticle -->

<script type="text/javascript">
<!--


function updateEditor()
{
	
	var checkb = document.getElementById('tg');
	var param = ' ';
	
	for( i =0; i < document.editorarticle.length; i++)
	{
		
	if( document.editorarticle.elements[i].type == "checkbox")
		{
		if( document.editorarticle.elements[i].name == 'artcheck[]' && document.editorarticle.elements[i].checked )
			{
			
			var title = document.editorarticle.elements[i].nextSibling.nodeValue.substring(1);

			var link = document.createElement('a');
			var reference = document.editorarticle.elements[i].value;
			link.appendChild(document.createTextNode(title));
			if (checkb.checked)
			{
				link.setAttribute('onclick', 'bab_popup(this.href);return false;');
				reference += '?popup=1';
			}
			
			link.setAttribute('href', reference);
			
			var span = document.createElement("span"); 
			span.appendChild(link);
			
			param +=' '+span.innerHTML;
			}
		}
	}

	opener.bab_dialog._return({
		'callback' 	: 'editorInsertText',
		'param'		: param
	});
	
	window.close();
	
}

//-->
</script>
<p>
	<a href="{ babUrlScript }?tg=editorarticle&amp;idx=browse">{ t_tree_view }</a>
</p>

<!--#if noarticles -->
<p style="text-align:center">
	{ t_noarticles }
</p>
<!--#else noarticles -->
<form method="post" name="editorarticle" action="{ babPhpSelf }">

<ul id="bab_editor_functions">
	<!--#in getnextarticle -->
	<li><input type="checkbox" name="artcheck[]" value="ovidentia:///articles/article/{ articleid }" style="vertical-align:middle" /> { titledisp }</li>
	<!--#endin getnextarticle -->
</ul>
<p>
	<input type="checkbox" id="tg" name="tg" checked="checked" /> { target_txt }
</p>
<p align="center">
	<button onclick="updateEditor();return false;">{ t_update }</button>
</p>
</form>
<!--#endif noarticles -->

<!--#end editorarticle -->